feat(typing): Add polars literal aliases#2352
Merged
MarcoGorelli merged 12 commits intomainfrom Apr 9, 2025
Merged
Conversation
Not from `polars`, but describes the subset we support for `LazyFrame.unique`
Copied over unchanged, but seems they could do with standardising
- Following the existing pattern of `SizeUnit`, `TimeUnit` - They appear in docs, but **not** in `nw.typing.__all__`
- Use `-` for bullet lists - Wrap literals in `"..."` - Single space after `:` - Titlecase for sentences - Inline code for parameter names (e.g. ``on``) - Wrap lines at ~80 characters
Member
Author
|
Thanks @MarcoGorelli 😍 |
dangotbanned
added a commit
that referenced
this pull request
Apr 12, 2025
MarcoGorelli
pushed a commit
that referenced
this pull request
Apr 15, 2025
* fix(typing): Narrow `IntoDataFrame` Will close #2344 * fix(typing): Remove `DataFrame` from `IntoFrame` * fix(typing): Narrow `IntoLazyFrame`, `IntoFrame` - Revealed two new `[overload-cannot-match]` from `mypy` - I agreed with that and removed the conflict sources Will close #2345 * fix(typing): Annotate `DataFrame._compliant_frame` Revealed quite a few other issues * chore: Add missing `CompliantDataFrame.pivot` + fix related quirks * fix(typing): Ensure `__iter__` is available on group_by * chore(typing): Fix most of `DataFrame` * chore(typing): Ignore interchange `[type-var]` * test(typing): Barely fix dodgy spark typing - I think this whole test needs rewriting - We shouldn't be depending on the internals like this * fix: Implement `to_numpy` to catch args https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.to_numpy.html * fix(typing): Annotate `LazyFrame._compliant_frame` * chore(typing): Ignore and add note for `spark_like` cast * chore(typing): Partial `v1` backport Spent waaaaaay too long trying to get this working * fix(typing): Just preserve `v1` behavior #2356 (comment) * simplify * try old `Union` #2356 (comment) * docs(typing): Provide more context on what and why Expanded on (#2356 (comment)) * chore(typing): Use `Sequence[str]` in `pivot` https://github.com/narwhals-dev/narwhals/pull/2356/files/5dd782522f23ed2aef3554a2aa89fc9903abd094#r2040702116 * refactor(typing): Use `PivotAgg` #2352
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #2359
What type of PR is this? (check all applicable)
Related issues
polars._typingliteral aliases #2359polars._typingaliases #2337Checklist
If you have comments or can explain your changes, please do so below
polars._typingaliases #2337)Preview
API Reference (1)
API Reference (2)
IDE Hover